#-*- coding:gb18030 -*-
#$Id: forms.py 32909 2008-09-02 08:18:53Z jorwen@NETEASE.COM $

from django import forms
from django.forms.widgets import TextInput, Textarea
from models import * 


class VoterInfoForm(forms.ModelForm):
	class Meta:
		model = VoterInfo


class PageFileForm(forms.ModelForm):
	content = forms.CharField(widget=Textarea({'cols': '50', 'rows': '40'}))
	class Meta:
		model = PageFile 
		fields = ('name', 'desc', 'content', 'status')
	

class VoteForm(forms.ModelForm):
	class Meta:
		model = Vote
		fields = ('name', 'desc', 'css', 'template', 'cache', 'expire_time', 'verify_type', 'keep_verify_time', 'voterinfo', 'status')


class QuestionForm(forms.ModelForm):
	class Meta:
		model = Question
		fields = ('content', 'min_answer_size', 'max_answer_size', 'order_num', 'qtype')


class ChoiceItemForm(forms.ModelForm):
	class Meta:
		model = ChoiceItem
		fields = ('content','votes_num', 'ctype', 'order_num')


